import java.util.concurrent.atomic.AtomicInteger;

public class Demo1 {

    private  int value;

//    public int getAndIncrement() {
//        int oldValue = value;
//        while (CAS(value, oldValue, oldValue + 1) != true) {
//            oldValue = value;
//        }
//        return oldValue;
//    }

    private Thread own = null;

//    public void SpinLock() {
//        while (!CAS(this.own, null, Thread.currentThread())) {
//
//        }
//    }

    public void unlock() {
        this.own = null;
    }

    public static void main(String[] args) {
        AtomicInteger atomicInteger = new AtomicInteger(0);
        System.out.println(atomicInteger);
        atomicInteger.getAndIncrement() ;
        System.out.println(atomicInteger);
    }
}
